package org.acghub.mtdb.common.type.impl;

import org.acghub.mtdb.common.Naming;
import org.acghub.mtdb.common.Type;
import org.acghub.mtdb.common.Visitor;
import org.acghub.mtdb.common.type.TypeBaseCollection;

/**
 * @author zhouhe
 */
public class TypeSet extends TypeBaseCollection {

    public TypeSet(Naming parent, Type valueType) {
        super(parent, valueType);
    }

    @Override
    public void accept(Visitor visitor) {
        visitor.visit(this);
    }

    /**
     * 获取java接口类型
     *
     * @return
     */
    @Override
    public String javaInterfaceType() {
        return "java.util.Set<" + getValueType().javaInterfaceType() + ">";

    }

    /**
     * 获取java实现类型
     *
     * @return
     */
    @Override
    public String javaImplType() {
        return "java.util.HashSet<>()";
    }

    @Override
    public String getName() {
        return "set";
    }
}
